<template>
    <div class="login">
        <div class="login-weaper">
            <div class="login-left">
                <div class="login-time">
                    2023-11-24 23:19:43 星期五 第四季度
                </div>
                <div class="login-left-box"></div>
            </div>
            <div class="login-right">
                <div class="login-main">
                    <div class="login-title">
                        欢迎登录
                        <div class="login-header-help">
                            没有账户？
                            <span
                                class="login-header-link"
                                @click="$router.push('/register')"
                            >
                                免费注册
                            </span>
                        </div>
                    </div>
                    <Account v-if="loginType == 0" />
                    <Mobile v-else />
                    <div class="login-panel">
                        <span @click="switchLoginType">
                            {{ loginType == 0 ? '验证码登录' : '密码登录' }}
                        </span>
                        <span>忘记密码</span>
                    </div>
                    <Third />
                </div>
            </div>
        </div>
    </div>
</template>
<script setup lang="ts" name="loginIndex">
import { ref } from 'vue'
import Account from './component/Account.vue'
import Mobile from './component/Mobile.vue'
import Third from './component/Third.vue'

//登录方式
const loginType = ref(0)
/**
 * 切换登录方式
 */
const switchLoginType = () => {
    loginType.value = loginType.value == 1 ? 0 : 1
}
</script>
<style scoped lang="scss">
.login {
    height: 100%;
    width: 100%;
    overflow: hidden;
    display: flex;
    position: relative;
    // background-image: url('@/assets/bg.svg');
    background-size: cover;

    .login-weaper {
        margin: auto;
        height: 500px;
        display: flex;
        box-sizing: border-box;
        position: relative;
        z-index: 1;
        border: none;
        box-shadow: 0px 20px 40px 0px rgba(0, 0, 0, 0.2);

        .login-left {
            width: 491px;
            padding: 20px;
            font-size: 16px;
            color: var(--prev-color-white);
            position: relative;
            background-color: var(--prev-color-primary);
            display: flex;
            flex-direction: column;
            border-top-left-radius: 4px;
            border-bottom-left-radius: 4px;

            .login-time {
                width: 100%;
                color: var(--prev-color-white);
                opacity: 0.9;
                font-size: 14px;
                overflow: hidden;
            }

            .login-left-box {
                flex: 1;
                overflow: hidden;
                position: relative;
                z-index: 1;
                display: flex;
                align-items: center;
                padding: 80px 45px;
                background-image: url('@/assets/images/platform.png');
                background-size: cover;
            }
        }

        .login-right {
            width: 491px;
            padding: 20px;
            position: relative;
            align-items: center;
            display: flex;
            background-color: var(--prev-color-white);
            border-top-right-radius: 4px;
            border-bottom-right-radius: 4px;

            .login-main {
                margin: 0 auto;
                width: 70%;

                .login-title {
                    margin-bottom: 30px;
                    font-weight: 500;
                    font-size: 22px;
                    letter-spacing: 4px;

                    .login-header-help {
                        font-size: 14px;
                        letter-spacing: 2px;
                        margin-top: 10px;
                        color: #999;
                        font-weight: 400;

                        .login-header-link {
                            color: #4285f4;
                            cursor: pointer;
                        }
                    }
                }
            }
        }
    }

    .login-panel {
        display: flex;
        justify-content: space-between;
        margin-top: 10px;
        color: var(--prev-color-primary);

        span {
            cursor: pointer;
        }
    }
}
</style>
